﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPageNavStepTwoCol.master" AutoEventWireup="true" CodeBehind="BabyGroup.aspx.cs" Inherits="WebSite.BabyGroup" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="js/baby.js" type="text/javascript"></script>
    <script src="js/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
    <link href="js/uploadify/uploadify.css" rel="stylesheet" type="text/css" />
    <link href="js/jquery.colorbox/colorbox.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery.colorbox/jquery.colorbox-min.js" type="text/javascript"></script>
    <link href="css/ImageUploadCut.css" rel="stylesheet" type="text/css" />
    <script src="js/ImageUploadCut.js" type="text/javascript"></script>

    <style type="text/css">
        div.msgitem
        {
            margin-top: 10px;
        }
        
        div.pager
        {
            text-align: center;
            margin-top: 20px;
        }
        div.msgitem .headimg
        {
        	display:inline-block;
            border: 2px solid #FFAE18;
            width: 100px;
            height: 100px;
            float:left;
        }
        div.msgitem .msgbody
        {
            display: inline-block;
            padding: 10px 0 0 10px;
            vertical-align: top;
            width: 500px;
            float:left;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div>
        <% if (babyB == null) // 右侧为空图
           { %>
        <div class="twobabyphoto">
            <div>
                <img class="single img1" src="<%= babyA.BabyHeadImg %>" alt="" />
                <img class="single img2" src="/images/babygroup/waitselect_318.png" alt="" />
            </div>
            <div class="centertext">
                <div class="hgiconc">
                    <a href="/LookingForTeam.aspx">
                        <img class="gogroup" src="images/BabyGroup/gogroup.png" />
                    </a>
                </div>
            </div>
        </div>
        <% }
           else
           { %>
        <div class="twobabyphoto teambabyphoto">
            <div>
                <img alt="teamimg" class="imgteam imgteam_big" src="<%= curTeam.TeamHeadImg %>" />
            </div>
            <div class="">
                <div class="hgiconc" style="text-align:center">
                    <!--
                    <div style="padding-left: 240px">
                        <input id="uploadTeamHeadImageFile" type="file" />
                        <input type="hidden" id="hdTeamHeadImage" name="hdTeamHeadImage" />
                    </div>
                    -->
                    <div class="ft_18">决赛进行中，去给晋级宝宝帮投票吧！</div>
                    <% if ( curTeam != null )
                       { %>
                       <div class="ft_18">晋级赛票数：<%= curTeam.TeamVoteNum %> 票</div>
                    <%} %>
                    <div></div>
                </div>
            </div>
        </div>
        <%
           } %>
        <div class="babygrouptitle">
            <span class="Top ft_14">
                <%= curTeam == null ? babyA.BabyTeamName : curTeam.TeamName %></span>
        </div>
        <div class="babygroupslogan">
            <div class="Yahei slogantext">
                <%= babyA.BabyTeamDeclaration %></div>
        </div>
        <div class="twobabyintro">
            <div>
                <div class="babyintro baby1">
                    <div class="orange ft_bold">
                        *宝宝编号为
                        <%= babyA.Id %></div>
                    <div class="textpart">
                        <p>
                            宝宝姓名：<%= babyA.BabyName %></p>
                        <p>
                            生日：<%= Common.NullableHelper.CastValueType( babyA.BabyBirthday ).ToString("yyyy-MM-dd") %></p>
                        <p>
                            年龄：<%= WebSite.Core.AgeCalcHelper.AgeCalc( babyA.BabyBirthday ) %></p>
                        <p>
                            性别：<%= Common.NullableHelper.CastValueType( babyA.BabySex ) ==1 ? "男" : "女" %></p>
                        <p>
                            城市：<%=babyA.LiveProvince %></p>
                    </div>
                    <div>
                        &nbsp;</div>
                    <div class="orange ft_bold">
                        宝宝介绍：</div>
                    <div>
                        <p>
                            <%= babyA.Introduction %></p>
                    </div>
                </div>
                <div class="babysepar">
                </div>
                <div class="babyintro baby2">
                    <div class="orange ft_bold">
                        *宝宝编号为
                        <%= babyB == null ? "" : babyB.Id.ToString() %></div>
                    <div class="textpart">
                        <p>
                            宝宝姓名：<%= babyB == null ? "" : babyB.BabyName%></p>
                        <p>
                            生日：<%= babyB == null ? "" : Common.NullableHelper.CastValueType( babyB.BabyBirthday ).ToString( "yyyy-MM-dd" )%></p>
                        <p>
                            年龄：<%= babyB == null ? "" : WebSite.Core.AgeCalcHelper.AgeCalc( babyB.BabyBirthday )%></p>
                        <p>
                            性别：<%= babyB == null ? "" : Common.NullableHelper.CastValueType( babyB.BabySex ) == 1 ? "男" : "女"%></p>
                        <p>
                            城市：<%= babyB == null ? "" : babyB.LiveProvince%></p>
                    </div>
                    <div>
                        &nbsp;</div>
                    <div class="orange ft_bold">
                        宝宝介绍：</div>
                    <div>
                        <p>
                            <%= babyB == null ? "" :  babyB.Introduction%></p>
                    </div>
                </div>
                <div class="clearfloat"></div>
            </div>
            <div class="midext">
                <a class="green2" href="/SubmitInfo.aspx">修改个人资料</a>
            </div>
        </div>
        <div class="babygrouptitlehighlight">
            <!--  
            <div>
                <img src="images/BabyGroup/demo_upload.png" />
            </div>
            <div class="lefttext">
                <img src="images/BabyGroup/uploadintro.png" />
            </div>
            -->
        </div>
        <div class="PhotoGroup">
            <div class="PhotoGroupText">
                <div class="yahei Text" style="">
                    <%= babyA.BabyName %></div>
            </div>
            <div class="PhotoGroupItem">
                <img src="<%= babyAHeadImage %>" />
            </div>
            <div class="PhotoGroupItem">
                <img src="<%=babyALiveImage1 %>" />
            </div>
            <div class="PhotoGroupItem">
                <img src="<%=babyALiveImage2 %>" />
            </div>
            <div class="clearfloat"></div>
        </div>
        <div class="PhotoGroup">
            <div class="PhotoGroupText">
                <div class="yahei Text" style="">
                    <%= babyB == null ? "" : babyB.BabyName%></div>
            </div>
            <div class="PhotoGroupItem">
                <img src="<%= babyBHeadImage %>" />
            </div>
            <div class="PhotoGroupItem">
                <img src="<%=babyBLiveImage1 %>" />
            </div>
            <div class="PhotoGroupItem">
                <img src="<%=babyBLiveImage2 %>" />
            </div>
            <div class="clearfloat"></div>
        </div>
    </div>
    <% if (curTeam != null)
       { %>
    <div class="commentbox">
        <textarea id="tbComment"></textarea>
    </div>
    <div style="text-align: right;">
        <a href="javascript:void(0);" onclick="addComment($('#tbComment').val());">
            <img alt="queding" src="images/BabyGroup/queding.png" /></a>
    </div>
    <% } %>
    
    <% for (int i = 0; i < listMessage.Count; i++)
       {
           var msg = listMessage[i];
    %>
    <div class="msgitem">
        <div class="headimg" >
            <a href="#" target="_blank">
                <img class="headimg" src="<%=msg.SendHeadImg %>" alt="" />
            </a>
        </div>
        <div class="msgbody">
            <p>
                [<%= Common.NullableHelper.CastValueType( msg.CreateTime ).ToString("MM-dd HH:mm:ss") %>
            ]<b>
                    <%= msg.SendBabyName %></b>:
            <p>
                &nbsp;</p>
            <p>
                <%=msg.Content %></p>
        </div>
        <div class="clearfloat"></div>
    </div>
    <% 
           if (i != listMessage.Count - 1)
           { %>
    <div class="separline_655">
    </div>
    <%       
           }
       }
    %>
    <script type="text/javascript">
        function callbackUploadHead(url) {
            $.ajax(
            {
                url: "/Server/UpdateTeamImg.ashx",
                data: { "img": url },
                cache: false,
                type: "POST",
                success: function (data, textStatus, jqXHR) {
                    if (data.code == 1) {
                        alert('组队头像更新成功');
                        window.location = "/babygroup.aspx";
                    }
                    else {
                        alert(data.message);
                    }
                },
                error: function () {
                    alert("系统错误");
                }
            });

            $.fn.colorbox.close();
        }
        $(document).ready(function () {
            SetUploadifyForTeamHead($("#uploadTeamHeadImageFile"), "callbackUploadHead");
        });
    </script>
</asp:Content>
